'use strict';

module.exports = appInfo => {
	const config = (exports = {});

	// use for cookie sign key, should change to your own and keep security
	config.keys = appInfo.name + '_1550040651048_7051';

	// config.private_key = `-----BEGIN PUBLIC KEY-----
	// MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4PvGb6bHyFSfMhBeHmyOGPrky
	// lk8u+MnasnEcxb9dO4UG6bSHzofsVrQTSnrzFrMIzpZZI/+gA8hJr1RyilqnhmvI
	// r6vnJ4IrOlzukpW5B2BNnkNfp71NTtviZOtvTfb/2z2TwKKcJZhinO76XqKdLIee
	// dQvegcMgr6doLmpX1QIDAQAB
	// -----END PUBLIC KEY-----
	// `
	// RSA非对称加密的私钥
	config.private_key = `-----BEGIN PRIVATE KEY-----
	MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALg+8ZvpsfIVJ8yE
	F4ebI4Y+uTKWTy74ydqycRzFv107hQbptIfOh+xWtBNKevMWswjOllkj/6ADyEmv
	VHKKWqeGa8ivq+cngis6XO6SlbkHYE2eQ1+nvU1O2+Jk629N9v/bPZPAopwlmGKc
	7vpeop0sh551C96BwyCvp2gualfVAgMBAAECgYAotT+Mw0Wdxy7T8RuByrU+o/0n
	QC6eojl3KJX1VXvCjbQGovxQRUGi5kVDPeGMdCd6eqqdZ2bDZBKMtUBjTk5Y9UKJ
	jijjzsfkpEAMSpGQSAOLWMTTico0myrP+igxsfbZizbofAVJubmVD2kIlvoeqJ34
	G8/s0HDYwpvhBlmeAQJBAOD4cJHGFV6ttNlzTfdKMzykiTx7BGMBfqOiemgS6j9X
	o6uzIFTEQ/dahfHc6s1bomvvtlU2snkLCOuLVa3nJukCQQDRqIuWW74hcfZOKPs4
	nDuCiIH41W8YFF/4dXYLILnGVr29iPiaTJA0+NzKyTiVePLIks1cgiNCLwUJDHM0
	g64NAkB2Kwk2CM4AxU1RSveRBTCUkfhkBFnxhz91xEp3kDfqvaYC8jvxSoZIzwu8
	V0YeSBuwhmFHsUtduSYeUznV9qzBAkBpVuXLhgzhgQDgBHc02kqMK0oiXBqVXqdZ
	jqrgrHCq1qo+sLM304AhHWjR+ogTkdFqNVg5Qqm0dytwgHDh0ceBAkAOvzOTHk2e
	GlTEZoHr4yQcgYU5/81PCHB3IYFlArK4vjJ3mLdKDyEXNN5j+ATKGC+WLwfobwia
	mA5XYbH/wyDp
	-----END PRIVATE KEY-----`;

	//
	config.csrf = {
		csrf: {
			enable: false,
			ignoreJSON: true
		},
		// 白名单
		domainWhiteList: '*'
	};

	config.cors = {
		origin: '*',
		allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
	};

	// 数据库的链接信息
	config.sequelize = {
		dialect: 'mysql',
		host: '193.112.18.190',
		port: 3306,
		database: 'blog',
		username: 'mariadb',
		password: 'mariadb@gz@'
	};

	// redis 链接信息
	config.redis = {
		client: {
			port: 6479, // Redis port
			host: '193.112.18.190', // Redis host
			password: '331244553',
			db: 0
		}
	};

	// 修改监听的端口
	config.cluster = {
		listen: {
			path: '',
			port: 8001,
			hostname: '0.0.0.0'
		}
	};
	// add your config here
	config.middleware = [];

	// 配置mysql 数据库的信息

	return config;
};
